/*
   Copyright (c) 2010 Bryce Alcock

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.com

 */

/*
 * ForwarderView.java
 *
 * Created on Oct 9, 2010, 1:21:36 PM
 */

package com.ecocrypt.proxy.forwarder.gui;

import java.awt.BorderLayout;

/**
 *
 * @author bryce
 */
public class ForwarderView extends javax.swing.JFrame {

    //There can only be one of these, and therefore this is a singleton.
    private static ForwarderView instance;

    public static ForwarderView getInstance(){

	// We do not have to worry about double check lock issue
	// because this is a single threaded applicaiton the first time
	// This method is called.
	if(instance==null){
	    instance = new ForwarderView();
	}
	return instance;
    }

    /** Creates new form ForwarderView */
    public ForwarderView() {
        initComponents();
	instance=this;
        jPanel1.add(ForwarderViewPanel.instance,BorderLayout.CENTER);
        setJMenuBar(ForwarderViewMenuBarBuilder.instance.menuBar());
    }

    public void addFownarderPanelTop(ForwarderPanelTop fpt){
        ForwarderViewPanel.instance.addFowarderPanelTop(fpt);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new java.awt.GridLayout(1, 0));

        jPanel1.setLayout(new java.awt.BorderLayout());
        getContentPane().add(jPanel1);

        pack();
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables

}
